﻿using SLClient.CustomerControls;
using SLClient.Extension;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace SLClient.Views
{
    public partial class ZxssqView : Page
    {
        public int lotteryCatagoryId;

        public ZxssqView()
        {
            PlayDataInfo ssqData;
            this.lotteryCatagoryId = 1;
            this.InitializeComponent();
            if (!IsolatedStorageHelper<PlayDataInfo>.IsSettingPersisted("ssq"))
            {
                ssqData = new PlayDataInfo(this.lotteryCatagoryId, "ssq");
            }
            else if (ViewDispatcher.SsqData.CurrentPlayData.OpenTime <= DateTime.Now)
            {
                ssqData = new PlayDataInfo(this.lotteryCatagoryId, "ssq");
            }
            else
            {
                ssqData = ViewDispatcher.SsqData;
            }
            BonusControl bonuscontrol = new BonusControl(ssqData);
            this.gridUp.Children.Add(bonuscontrol);
            bonuscontrol.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)0);
            bonuscontrol.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            LastOpenDataControl control2 = new LastOpenDataControl(ssqData);
            this.gridUp.Children.Add(control2);
            control2.SetValue(Grid.ColumnProperty, 1);
            control2.SetValue(FrameworkElement.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
            Top10WinnerControl control3 = new Top10WinnerControl(ssqData);
            this.gridDown.Children.Add(control3);
            control3.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)2);
            control3.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            control3.SetValue(Grid.ColumnProperty, 1);
            this.m_BetControl.InitPage(StringResource.ZxSsq, new BetPlayTypeInfo[] { new BetPlayTypeInfo(1, "双色[正]", new BetPlayInfo[] { new BetPlayInfo(3, "蓝码", 8, 1, 0x10, 0, 1, 1, 6, true), new BetPlayInfo(6, "红码", 11, 1, 0x21, 0, 1, 1, 0, true) }) }, bonuscontrol, this.lotteryCatagoryId);
        } 
    }
}
